<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>快来财</title>
    <style>
        .container {
            margin: 0 auto;
            padding: 20px;
            text-align: center;
            font-family: "Microsoft YaHei UI Light", serif;
        }

        .icon {
            margin: 30px;
            border-radius: 16px;
        }

        .name {
            font-size: 50px;
        }

        .download {
            width: 350px;
            border: none;
            border-radius: 8px;
            margin: 50px;
            color: white;
            padding: 15px 32px;
            text-align: center;
            display: inline-block;
            font-size: 45px;
            background-color: #4CAF50;
            box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
        }

        .download:hover {
            box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19);
        }

        .tutorial-title {
            font-size: 45px;
            margin-bottom: 60px;
        }

        .tutorial-bottom {
            font-size: 40px;
            color: red;
        }

        .tutorial-img {
            width: 60ch;
            margin: 10px;
            border: black 1px solid;
        }

        .we-chat {
            display: none;
            position: fixed;
            left: 0;
            top: 0;
            background: rgba(0, 0, 0, 0.8);
            filter: alpha(opacity=80);
            width: 100%;
            height: 100%;
            z-index: 100;
        }

        .we-chat-icon {
            width: 80ch;
            text-align: center;
            margin-left: 13ch;
            position: relative;
        }

        .ios-sign {
            display: none;
        }
    </style>
<body>
<div class="container">
    <div class="we-chat" id="weChatDiv">
        <img class="we-chat-icon" src="https://pro-mall-business.oss-cn-hangzhou.aliyuncs.com/ipa/live_weixin.png"/>
    </div>
    <img class="icon" src="https://pro-mall-business.oss-cn-hangzhou.aliyuncs.com/ipa/180x180.png">
    <h1 class="name">快来财 App</h1>
    <button id="downloadBtn" class="download" onclick="appDownload()">
        点击下载
    </button>
    <div id="downloadDiv">
    </div>
    <div id="ios-sign" class="ios-sign">
        <hr>
        <hr>
        <h2 class="tutorial-title">iOS 安装提示“未受信任的企业级开发者”攻略</h2>
        <h2 class="tutorial-bottom">设置 > 通用 > 设备管理 > 然后信任企业级应用即可</h2>
        <img class="tutorial-img"
             src="https://pro-mall-business.oss-cn-hangzhou.aliyuncs.com/ipa/tutorial/tutorial-1.jpg">
        <img class="tutorial-img"
             src="https://pro-mall-business.oss-cn-hangzhou.aliyuncs.com/ipa/tutorial/tutorial-2.jpg">
        <img class="tutorial-img"
             src="https://pro-mall-business.oss-cn-hangzhou.aliyuncs.com/ipa/tutorial/tutorial-3.jpg">
        <img class="tutorial-img"
             src="https://pro-mall-business.oss-cn-hangzhou.aliyuncs.com/ipa/tutorial/tutorial-4.jpg">
        <img class="tutorial-img"
             src="https://pro-mall-business.oss-cn-hangzhou.aliyuncs.com/ipa/tutorial/tutorial-5.jpg">
        <img class="tutorial-img"
             src="https://pro-mall-business.oss-cn-hangzhou.aliyuncs.com/ipa/tutorial/tutorial-6.jpg">
        <img class="tutorial-img"
             src="https://pro-mall-business.oss-cn-hangzhou.aliyuncs.com/ipa/tutorial/tutorial-7.jpg">
    </div>

    <script>
        window.onload = function () {
            const ua = navigator.userAgent.toLowerCase().toString();

            let isMacOS = (ua.indexOf("iphone") > -1 || ua.indexOf("ipod") > -1 || ua.indexOf("ipad") > -1);
            if (!isMacOS) {
//                window.location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.tykj.housekeeping';
            } else {
                document.getElementById("ios-sign").style.display = 'block';
            }
        };

        function appDownload() {
            const ua = navigator.userAgent.toLowerCase().toString();

            let isMacOS = ua.indexOf("iphone") > -1;
            // let isWeChat = ua.match('MicroMessenger');
            let isWeChat = ua.match('micromessenger');
            if (isMacOS) {
                window.location.href = 'itms-services://?action=download-manifest&url=https://pro-mall-business.oss-cn-hangzhou.aliyuncs.com/ipa/kuailaicai.plist';
                setTimeout(function () {
                    document.getElementById("downloadDiv").innerHTML = "<p style='color: #4CAF50;font-size: 30pt; font'>" + "正在安装，请按 Home 键在桌面查看" + "</p>";
                }, 1800);
            } else {
                if (isWeChat) {
                    let weChatDiv = document.getElementById('weChatDiv');
                    weChatDiv.style.height = window.innerHeight + 'px';
                    weChatDiv.style.display = 'block';

                    return false;
                } else {
                    window.location.href = 'https://pro-mall-business.oss-cn-hangzhou.aliyuncs.com/ipa/app_pc.apk';
                }
            }
        }

    </script>
</div>
</body>
</html>